package com.neusoft.databus.agent.pool.snmp;

import java.io.IOException;

import org.snmp4j.PDU;
import org.snmp4j.Snmp;
import org.snmp4j.Target;
import org.snmp4j.event.ResponseEvent;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * snmp连接封装类
 *
 * @author naxiang
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class SnmpWrapper {
    private Snmp snmp;
    private Target target;

    public ResponseEvent get(PDU pdu) throws IOException {
        return this.snmp.get(pdu, this.target);
    }

    public int getVersion() {
        return this.target.getVersion();
    }

}
